function graphics_ = gXfine_graphics(varargin)
% Taking cues from
%   Ball and Sekuler, "Direction-Specific Improvement in Motion
%   Discrimination." 1987, Vision Research, 27(6) pp. 953-965.
%
% Adding eye and lever response modalities, therefore additional tartets
%
% So, dXdots, 4 dXtargets (2 fixation and 2 saccade targets, 2 dX text
% (labels for targets), and feedback after each block.

% 2008 Benjamin Heasly at University of Pennsylvania

if nargin
    % get coherence and bgColor from args
    rootArgs = varargin{1};
else
    warning(sprintf('%s needs arguments', mfilename));
    rootArgs.coherence = 100;
    rootArgs.bgColor = [1 1 1];
end

arg_dXdots = { ...
    'x',            0, ...
    'y',            0, ...
    'diameter',     8, ...
    'size',         2, ...
    'speed',        10, ...
    'coherence',    rootArgs.coherence, ...
    'direction',    90, ...
    'density',      100, ...
    'wrapMode',     'wrap', ...
    'color',        [1,1,1,1]*255, ...
    'maskColor',    rootArgs.bgColor};

w = 8;
arg_dXtarget = { ...
    'y',            0, ...
    'x',            {0  0   -w  w}, ...
    'diameter',     {.2 .2  1   1}, ...
    'diameter2',    {6  4   5   5}, ...
    'color',        [255,255,255,8]};

arg_dXtext = { ...
    'y',            .35, ...
    'x',            {-(w+.8) w-.5}, ...
    'string',       {'same', 'different'}, ...
    'size',         20, ...
    'color',        [64,0,0]};

% {'group', reuse, set now, set always}
static = {'current', true, true, false};
graphics_ = { ...
    'dXdots',       1,  static, arg_dXdots; ...
    'dXtarget',     4,  static, arg_dXtarget; ...
    'dXtext',       2,  static, arg_dXtext; ...
    };